/** Created by CUIJA on 05-19-2017.*/

var angular = require('angular');

var core = require('../core');


var authRoutes = require('./routes/auth.routes');
var loginController = require('./controllers/login.controller');
var userService = require('./services/user.service');
var authConfig = require('./configs/auth.config');
var authInterceptorService = require('./services/authInterceptor.service');
const moduleName = 'auth';

angular.module(moduleName, [
        core
    ])
    .config(authRoutes)
    .factory('userService', userService)
    .factory('authInterceptorService', authInterceptorService)
    .config(function($httpProvider) {
        $httpProvider.interceptors.push('authInterceptorService')
    })
    .controller('loginController', loginController)
    .run(authConfig);

module.exports = moduleName;